BMEN90033 · Week 8
Back
BMEN90033 · WEEK 8 · FILTER APPLICATIONS

Filter applications in measurement systems.

A filter implements a frequency-selective gain. By specifying which frequency components are transmitted and which are attenuated, a measurement chain can separate signal from noise, prevent aliasing during sampling, suppress slow baseline drift, and reject narrow-band interference. Four worked examples are presented below: low-pass smoothing, anti-alias filtering prior to an analog-to-digital converter, high-pass removal of baseline wander in an electrocardiogram, and a notch filter at the mains frequency.

smoothing anti-aliasing baseline wander mains rejection
scroll
01low-pass smoothing

Low-pass smoothing. Attenuation of out-of-band noise.

Most physiological signals carry their diagnostic information within a relatively narrow low-frequency band, whereas sensor noise, thermal noise, and electromagnetic pickup distribute their energy across a much wider range. A low-pass filter applies a frequency-dependent gain that is near unity within the passband and near zero within the stopband, so signal components are preserved while out-of-band noise is suppressed.

$$ |H_{\text{LPF}}(f)| \;=\; \frac{1}{\sqrt{1 + (f / f_c)^2}}, \qquad y[n] \;=\; \alpha\, x[n] \,+\, (1-\alpha)\, y[n-1]. $$

Description of the figure.

The red trace shows the recorded input, comprising a slow biosignal, additive white noise, and a $50\,\mathrm{Hz}$ component representing mains pickup. The green trace shows the same input after a first-order low-pass filter with cutoff $f_c$. The faint blue trace is the underlying noise-free signal, included for reference; the filtered output approaches this reference when $f_c$ lies below the noise band yet above the signal band.

The lower panel displays the filter magnitude response on a linear frequency axis. As $f_c$ is varied, the roll-off region translates accordingly: components above the corner are progressively attenuated, while components below it are transmitted with approximately unity gain.

The choice of $f_c$ involves a trade-off. A cutoff placed too high leaves residual noise within the passband, whereas a cutoff placed too low attenuates signal components and broadens sharp transitions in the time domain. A reasonable starting point is the highest frequency expected within the signal of interest, with the cutoff placed slightly above it.
cutoff 5.0 Hz show noisy input show clean reference
time domain · input and low-pass output
magnitude response · |HLPF(f)|
02anti-alias filtering

Anti-alias filtering. Bandlimiting prior to sampling.

A sampler operating at rate $f_s$ can uniquely represent frequencies only up to the Nyquist limit $f_s/2$. Any input component above this limit is folded back into the baseband at a lower apparent frequency, where it becomes indistinguishable from a genuine low-frequency component. The only way to prevent this is to remove the high-frequency content with a low-pass filter applied before the sampler. Such a filter is termed the anti-alias filter.

$$ f_{\text{alias}} \;=\; \bigl|\, f_{\text{in}} - n f_s \,\bigr|, \quad n = \mathrm{round}(f_{\text{in}} / f_s). $$

Description of the figure.

The faint blue curve represents the continuous-time input sinusoid. The yellow markers indicate the sample values acquired at rate $f_s$. The bold trace passing through these markers shows the ideal sinc reconstruction, that is, the continuous waveform that would be produced by an ideal digital-to-analog converter operating on those samples. With the anti-alias filter disabled, an input above $f_s/2$ yields samples consistent with a lower-frequency sinusoid; the resulting reconstruction is plotted in purple and corresponds to the aliased component. With the filter enabled, the input is attenuated before sampling, the samples approach zero, and the reconstruction is correspondingly flat.

The lower panel illustrates the spectrum. The green region indicates the passband below $f_s/2$, and the red region indicates the stopband above. A blue stem marks the position of the input frequency, and a purple stem marks the location at which the alias appears within the baseband. As the input frequency exceeds $f_s/2$, the stem in the stopband produces a corresponding fold-back component within the passband.

The anti-alias filter must be implemented in hardware, immediately preceding the analog-to-digital converter. It cannot be applied in software after sampling, because at that point the aliased components are already superimposed on the legitimate signal. A digital low-pass filter applied post-sampling can reduce broadband noise but cannot recover information lost to aliasing at the same baseband frequency.
input freq 70 Hz sample rate 100 Hz anti-aliasing off
time domain · continuous input · samples · reconstruction
spectrum · baseband and folding region
03baseline wander removal

Baseline wander removal. High-pass rejection of slow drift.

An electrocardiogram is recorded on a baseline that is not stationary. Respiration, electrode polarisation, and patient movement each contribute slow voltage drifts whose amplitude can substantially exceed that of the QRS complex. Although the drift contains no diagnostic information, it interferes with threshold-based beat detection and may drive downstream amplifiers into saturation. A high-pass filter is therefore applied to transmit the QRS frequencies, which carry the majority of the diagnostic content, while rejecting the very low frequencies associated with the drift.

$$ |H_{\text{HPF}}(f)| \;=\; \frac{f / f_c}{\sqrt{1 + (f / f_c)^2}}, \qquad y[n] \;=\; \alpha\,(y[n-1] + x[n] - x[n-1]). $$

Description of the figure.

The dashed grey curve represents the slow drift component, with energy concentrated below $0.5\,\mathrm{Hz}$. The red trace shows the recorded ECG, comprising the underlying beats summed with this drift. The faint blue trace is the noise-free reference, included for comparison. The green trace is the high-pass output: as $f_c$ is increased through the drift band, the baseline progressively flattens. When $f_c$ is increased beyond the drift band, however, low-frequency components of the QRS complex are also attenuated, producing distortion of the waveform morphology.

The lower panel shows the high-pass magnitude response. The curve is the geometric complement of the low-pass response presented in section 01. Both responses arise from the same first-order pole; the numerator of the transfer function determines the filter type rather than the location of the corner frequency.

Clinical ECG monitors typically employ a high-pass corner near $0.5\,\mathrm{Hz}$ for diagnostic recordings and approximately $1\,\mathrm{Hz}$ for continuous monitoring. Higher cutoff frequencies flatten the baseline more effectively but introduce distortion of the ST segment, which is used in the assessment of ischaemia. The selection of $f_c$ therefore reflects a clinical compromise rather than an arbitrary choice.
cutoff 0.70 Hz show clean reference
time domain · ECG with drift and high-pass output
magnitude response · |HHPF(f)|
04mains-frequency notch

Mains-frequency notch. Rejection of narrow-band interference.

Capacitive coupling between mains wiring and the patient leads introduces a sinusoidal interference at $50\,\mathrm{Hz}$, or $60\,\mathrm{Hz}$ in some regions, into every biopotential recording. Because this interference is narrow-band and centred on a known frequency, the appropriate filter is one that attenuates only that frequency while transmitting all others. A filter exhibiting this response is termed a notch filter.

$$ H_{\text{notch}}(s) \;=\; \frac{s^2 + \omega_0^2}{s^2 + (\omega_0 / Q)\, s + \omega_0^2}, \qquad \omega_0 = 2\pi f_0. $$

The numerator places a pair of imaginary zeros on the $j\omega$ axis at $\pm j\omega_0$, so the gain at $f_0$ is identically zero. The denominator places poles a short distance to the left of these zeros, and the quality factor $Q$ governs that distance. A larger value of $Q$ produces a narrower notch, attenuating a small band around $f_0$ while leaving adjacent frequencies essentially unaffected.

Description of the figure.

The red trace shows the contaminated ECG, comprising the clean signal summed with a $50\,\mathrm{Hz}$ sinusoid of sufficient amplitude to obscure the QRS detail. The faint blue trace is the noise-free reference. The green trace is the notch output. When $f_0$ is aligned with $50\,\mathrm{Hz}$ and $Q$ is sufficiently large, the interference is suppressed and the underlying waveform morphology is recovered. The lower panel shows the notch magnitude response: a sharp attenuation at $f_0$ and approximately unity gain elsewhere.

The notch must be tuned to the true mains frequency rather than to its nominal value. A $50\,\mathrm{Hz}$ notch applied to a recording with $50.1\,\mathrm{Hz}$ pickup leaves a small residual whose envelope beats at $0.1\,\mathrm{Hz}$. In practice, a slightly reduced $Q$ trades a wider stopband for greater tolerance to mains frequency variation, and contemporary instruments frequently employ adaptive notches that estimate the interference frequency directly from the data.
notch f0 50 Hz quality Q Q = 12 50 Hz hum on
time domain · contaminated ECG and notch output
magnitude response · |Hnotch(f)|